package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class 删除字符 {
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       final static int N=110;
       static int t,n;
       static String str;
       public static void main(String[] args) throws IOException {
		      str=br.readLine();
		      str=str+" ";
		      n=str.length();
		      t=Integer.parseInt(br.readLine());
		      //贪心
		      while(t-->0){
		    	  for(int i=0;i<str.length();i++){
		    		  if(str.charAt(i)>str.charAt(i+1)){
		    			  str=str.replaceFirst(str.charAt(i)+"", "");
		    			  break;
		    		  }
		    	  }
		      }
		      System.out.print(str);
	   }
}
